package com.edu.mapper;

import com.edu.bean.Book;
import com.edu.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Auther:zzp
 * @Date:2025/9/27-1:52:53
 */
public interface StudentMapper {

    /*查询*/
    @Select("select * from student WHERE stuId = #{stuId}")
    Student selectStudentById(int stuId);

    /*删除*/
    @Delete("delete from student where stuId = #{stuId}")
    int deleteStudent(int stuId);

    /*增添*/
    @Insert("INSERT INTO student(stuName,stuAge,stuSex) VALUES (#{stuName},#{stuAge},#{stuSex})")
    int insertStudent(Student student);

    /*修改*/
    @Update(" update student SET stuName = #{stuName} , stuAge = #{stuAge} , stuSex = #{stuSex} WHERE stuId = #{stuId}")
    int updateStudent(Student student);
}
